package cn.pfund.entity;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.springframework.web.multipart.MultipartFile;

 /**
 *首页图片
 * @author zhaominglei qq:351024274，专注于网站、app和游戏开发。
 * @date 2017年1月19日
 */
@Entity
@Table(name="pfund_index_image")
public class IndexImage extends OrderEntity implements Serializable {
	private static final long serialVersionUID = 3354473621976770651L;
	public static final Integer INDEXIMAGE_LUNBO_TYPE = 1;
	public static final Integer INDEXIMAGE_HZHB_TYPE = 2;
	public static final Integer INDEXIMAGE_YQLJ_TYPE = 3;
	@SuppressWarnings("serial")
	public static final Map<Integer, String> map = new LinkedHashMap<Integer, String>(){
		{
			put(INDEXIMAGE_LUNBO_TYPE, "轮播图片");
			put(INDEXIMAGE_HZHB_TYPE, "合作伙伴");
			put(INDEXIMAGE_YQLJ_TYPE, "友情链接");
		}
	};
	/** 标题 **/
	private String title;
	/** 图片 **/
	private String source;
	/** 类型1轮播图片 2合作伙伴 3友情链接**/
	private Integer type;
	/** 网址 **/
	private String url;
	/** 文件 */
	private MultipartFile file;
	
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	@Transient
	public MultipartFile getFile() {
		return file;
	}
	public void setFile(MultipartFile file) {
		this.file = file;
	}
	@Transient
	public String getTypeLabel() {
		return map.get(getType());
	}
}
